new Vue({
    el: '#app',
    data: function () {
        return {
            code:'',
            dataTypes:[{
                label:'疫情总览导入',
                value:'EPIDEMIC_MASTER'
            }],
            fileList:[],
            actionUrl:"../import/excel",
            errorMsg:'',
            configForm:{
                importType:'0',
                updateColumnIndex:0
            },
            isUpdate: false
        }
    },
    mounted:function(){


    },
    methods: {
        submitUpload: function() {
            this.$refs.upload.submit();
        },
        handleRemove:function(file, fileList) {
            console.log(file, fileList);
        },
        handlePreview:function(file) {
            console.log(file);
        },
        clearFile: function () {
            this.fileList = [];
            this.errorMsg = '';
        },
        uploadSuccess: function (response, file, fileList) {
            if(response.code == 200){
                this.$message({
                    message: response.message,
                    type: 'success'
                });
            }else{
                this.$message.error("上传失败");
                this.errorMsg= response.message;
            }
        },
        uploadError: function (err, file, fileList) {
            console.log(err);
            this.$message.error(err.message);
        },
        downloadTemplate: function () {
            window.location.href="../export/template"
        },
        beforeUpload :function (file) {
            /*var me = this;
            this.actionUrl = me.actionUrl+"?updateIndex="+me.configForm.updateColumnIndex;*/
            return true;
        }
    }
});